/************************************************************************
*File Name: pwd_serve.c
*Author: wky
*Created Time: 2023年06月22日 星期四 18时28分28秒
*Describtion: 
************************************************************************/
#include "threadPool.h"
#include <strings.h>


int pwd(int netfd,char *real_path,int virtual_start)
{
    //printf("real_path = %s\n", real_path);
    //printf("strlen = %ld\n",strlen(real_path));

    train_t train;
    bzero(&train, sizeof(train));

    int len_path = strlen(real_path) - virtual_start;
    //printf("len_path = %d\n",len_path);

    for(int i = 0,j=virtual_start; i < len_path ; ++i,++j){
        train.data[i] = real_path[j];
    }
    train.length = strlen(train.data);
    //printf("train.length = %d\n",train.length);
    //printf("virtual_start = %d\n",virtual_start);
    send(netfd, &train, sizeof(int)+train.length , MSG_NOSIGNAL);
    //printf("%s\n",train.data);

    return 0;
}


